///////////////////////////////////////////////////////////
///////////////// Have an itch? Scratch it! ///////////////
///////////////////////// SCRATCH /////////////////////////
/////////////////////  A MUD  Server   ////////////////////
///////////////////// By: Jared Devall ////////////////////
/////////////////////      Thanks:     ////////////////////
/////////////////////  DIKU/Merc/ROM   ////////////////////
///////////////////// Aetas/Deus Gang  ////////////////////
/////////////////////       Beej       ////////////////////
///////////////////////////////////////////////////////////
// Altered by CTonk ( ctonk87@hotmail.com )

// commands.h

#ifndef H_COMMANDS
#define H_COMMANDS


// The base command class
class Command
{
	public:
		// Constructors
		virtual ~Command() {};

		// Data
		std::string _name;
		std::string _shortcut;
		std::string _group;
		bool        _enabled;
		std::string _disabler;

		// Methods
		virtual bool Execute( Character*, const std::string& args ) {return true;}
};


#define DEF_COMMAND( CommandName )									\
class CommandName: public Command									\
{																	\
    public:															\
		CommandName();												\
																	\
		std::string _name;											\
		std::string _shortcut;										\
		std::string _group;											\
		bool        _enabled;										\
		std::string _disabler;										\
																	\
		void SetName( const std::string& );							\
		void SetShortcut( const std::string& );						\
		void SetGroup( const std::string& );						\
		void SetEnabled( bool vlaue );								\
		void SetDisabler( const std::string& );						\
																	\
		bool Execute( Character* , const std::string& );			\
};																	\
																	\
inline void CommandName::SetName( const std::string& name )			\
{																	\
	_name = name;													\
	Command::_name = name;											\
	_shortcut = "&";												\
	Command::_shortcut = "&";										\
}																	\
																	\
inline void CommandName::SetGroup( const std::string& group )		\
{																	\
	_group = group;													\
	Command::_group = group;										\
}																	\
																	\
inline void CommandName::SetEnabled( bool value )					\
{																	\
	_enabled = value;												\
	Command::_enabled = value;										\
}																	\
																	\
inline void CommandName::SetShortcut( const std::string& shortcut )	\
{																	\
	_shortcut = shortcut;											\
	Command::_shortcut = shortcut;									\
}																	\
																	\
inline void CommandName::SetDisabler( const std::string& disabler )	\
{																	\
	_disabler = disabler;											\
	Command::_disabler = disabler;									\
}




#endif // #ifndef H_COMMANDS